namespace ClassyBlog.Infrastructure.Specs.Unit
{
    using Machine.Specifications;
    using NSubstitute;

    [Subject(typeof(DefaultWebViewPage))]
    public class DefaultWebViewPageSpec
    {
        static IRenderer renderer;
        static DefaultWebViewPage view;

        Establish context = () =>
        {
            renderer = Substitute.For<IRenderer>();
            view = new DefaultWebViewPageTestDouble();
        };

        Because of = () => view.SetRenderer(renderer);

        It should_be_the_same = () => view.Renderer.ShouldBeTheSameAs(renderer);

        private class DefaultWebViewPageTestDouble : DefaultWebViewPage
        {
            public override void Execute()
            {
            }
        }
    }
}